import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'list',
  template: `
              <ul class="list">
                <li *ngFor="let contact of contacts">
                  <list-item [contact]="contact"></list-item>
                </li>
              </ul>
            `
})

export class ListComponent implements OnInit {
  contacts: any[] = [
    {
      name: '孙悟空',
      tel: 18600000000
    },
    {
      name: '白晶晶',
      tel: 18600000001
    },
  ];
  ngOnInit(): void {
    console.log('list init');
  }
}

